import { merge } from 'webpack-merge'
import base from './config.base'
import paths from './paths'
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin'
import { Configuration } from 'webpack'

const devConfig: Configuration = {
  mode: 'development',
  entry: [paths.src + '/main.tsx'],
  // @ts-ignore
  devServer: {
    port: 3000,
    hot: true,
  },
  target: 'web',
  plugins: [new ReactRefreshWebpackPlugin()],
  devtool: 'eval-cheap-module-source-map',
}

export default merge(base, devConfig)
